"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("../props.cjs"),o=e.defineComponent({name:"ep-amount",props:t.default,emits:["update:modelValue"],setup(t,{emit:o}){const l=e.computed(()=>t.options.permission>0);return{fieldModel:e.computed({get:()=>l.value&&!t.modelValue?"--":t.modelValue,set(e){o("update:modelValue",e)}}),isDetail:l,handleInput:e=>{let l=e.replace(/[^\d.]/g,"").replace(/^0+(\d)/,"$1").replace(/(\..*)\./g,"$1");l=2===t.options.decimalPlaces?l.replace(/(\.\d{2})\d+/g,"$1"):l.replace(/(\.\d)\d+/g,"$1"),l!==e&&o("update:modelValue",l)},handleBlurEvent:e=>{const l=t.options.min||0,d=t.options.max||9;if(e>d&&o("update:modelValue",d),e<l&&o("update:modelValue",l),t.options.omitEndZero&&-1!==String(e).indexOf(".")){const t=String(e).replace(/\.?0*$/,"");t!==String(e)&&o("update:modelValue",t)}}}}});exports.default=o;
